Skip to content

add rustfmt support for cfg_select #144323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

folkertdev
Copy link
Contributor

tracking issue: #115585

Done here because rust-lang/rustfmt has not been synced for a while and uses a nightly version where cfg_select! is not yet a builtin macro.

r? @ytmimi

@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2025

Failed to set assignee to ytmimi: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2025
@folkertdev
Copy link
Contributor Author

@ytmimi seems like I can't officially make you a reviewer, so we'll have to figure out how to merge this: I can r+, or we can find someone else to just greenlight it. The changes only touch rustfmt so I think your approval should suffice.

@ytmimi
Copy link
Contributor

ytmimi commented Jul 23, 2025

Maybe you can't officially assign me, but I should definitely have the ability to r+ this once I've had a chance to take a look.

@calebcartwright
Copy link
Member

I think we might want to hold off on merging this for a tad longer. The style team has been discussing possible formatting prescriptions for the macro in our weekly meetings and while we're getting closer there's still a few things we're trying to iron out - rust-lang/style-team#201

My preference would be to give that another week or two to hopefully avoid double code churn

@joshtriplett
Copy link
Member

joshtriplett commented Jul 30, 2025

I think the proposed formatting looks reasonable, as far as the examples go.

@folkertdev Could you please add some examples that include very long left-hand sides in cfg_select!, that might necessitate wrapping? (It's fine if they don't currently wrap, @traviscross and I just wanted to see some examples and how they turned out with the proposed formatting.)

Please include both examples where the line is overlong, and examples where the user manually wrapped the left-hand side.

@folkertdev folkertdev force-pushed the cfg-select-builtin-macro-fmt branch 3 times, most recently from 5b15896 to 89a83da Compare July 30, 2025 20:24
@folkertdev
Copy link
Contributor Author

folkertdev commented Jul 30, 2025

I added some formatting examples. They do in fact already format nicely.

I did just notice that comments on the branches, like below, disappear upon formatting

cfg_select! {
    // This comment will disappear when formatting. 
    any(true) => {}
}

For lazy_static! apparently formatting is just skipped if there is a comment inside anywhere? For macro_rules! I'm not really sure what happens. It just seems to work but I can't find logic that handles comments explicitly.

Does rustfmt have some way of handling this?

@traviscross
Copy link
Contributor

For context, @joshtriplett and I talked about this in the style team meeting, and @folkertdev, if you're interested in working with us on it, we were interested in using this PR to explore possible solutions to the questions we had raised about how to format this, such as what Josh mentioned about long left-hand sides.

If we can work out some good rules in this PR, and use the test cases in it to verify that we're happy with the formatting of all the hard cases that we can think of, then we can write down the rules in the style guide around the behavior that's proposed and that we agree on here.

Generally, our preference, if possible, is some wrapping rule for the LHS that keeps things below the maximum column width and that we can later apply, over a style edition, to normal cfg attributes.

@folkertdev folkertdev force-pushed the cfg-select-builtin-macro-fmt branch from 89a83da to 08240dd Compare July 30, 2025 23:16
@folkertdev
Copy link
Contributor Author

well, I'd like to see cfg_select! stabilized, so whatever helps that move forward, let's do that.

I added some of the long unbreakable line examples, just so we track their behavior. There we also see that comments inside of the block are dropped which is a bit strange because there we just give a tokenstream to the formatter, and I would have assumed that it handled comments.

For the simple cases I think the current behavior is what we want right? though I assume the => { isn't really taken into account when deciding whether to break or not, which might make the line exceed the line length.

@folkertdev folkertdev force-pushed the cfg-select-builtin-macro-fmt branch from 08240dd to ccfa107 Compare July 30, 2025 23:41
@rust-log-analyzer

This comment has been minimized.

@traviscross
Copy link
Contributor

For the simple cases I think the current behavior is what we want right?

The trouble is that rustfmt's stability policy is that once it formats a construct, the formatting must remain byte-identical within that style edition. So whatever our behavior for the non-simple cases ends up being what we have to commit to and document in the style guide.

So it's better if we can come up with reasonable rules for the non-common cases as well, so that we can commit to reasonable behavior for those cases too. We're open to and interested in seeing proposed behavior there as part of this PR.

@folkertdev folkertdev force-pushed the cfg-select-builtin-macro-fmt branch from ccfa107 to 17d516f Compare July 31, 2025 09:10
Copy link
Contributor Author

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I just meant to say that what we need is refinement, but the broad strokes work as desired.

Comment on lines 1532 to 1535
// The cfg plus ` => {` should stay within the line length.
let rule_shape = shape
.sub_width(" => {".len())
.max_width_error(shape.width, span)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to have the desired effect, am I using this right?

Comment on lines +97 to +115
any(feature = "acdefg", true, true, true, true, true, true, true, true) => {
compile_error!("foo")
}
any(feature = "acdefgh123", true, true, true, true, true, true, true, true) => {
compile_error!("foo")
}
any(
feature = "acdefgh1234",
true,
true,
true,
true,
true,
true,
true,
true
) => {
compile_error!("foo")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently this breaks when the cfg part exceeds 80 characters. I've tried to take the => { into account, but that doesn't seem to have any effect. Also when the rhs really is empty, we'd need to consider => {} for the length.

The above still has issues with comments too, which I'm not sure how to deal with.

So @ytmimi @calebcartwright a rustfmt review is probably also a good idea at this point?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a very brief look at this the other day and I had some suggestions for changes. I'll do my best to wrap up my review soon.

@joshtriplett
Copy link
Member

#145233 will necessitate an update here.

Also, there should be an update to the style guide, though that can wait until after this PR is working.

@jieyouxu jieyouxu added A-rustfmt Area: Rustfmt T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. F-cfg_select `#![feature(cfg_select)]` labels Aug 15, 2025
@jieyouxu
Copy link
Member

Maybe you can't officially assign me, but I should definitely have the ability to r+ this once I've had a chance to take a look.

@ytmimi it's because rustfmt team doesn't yet have write access on r-l/r despite having r+ permissions. See rust-lang/team#1948.

Kobzol added a commit to Kobzol/rust that referenced this pull request Aug 15, 2025
Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`

Make e.g. rust-lang#144323 more obvious who should be reviewing it and easier to filter.
rust-timer added a commit that referenced this pull request Aug 15, 2025
Rollup merge of #145448 - jieyouxu:rustfmt-labels, r=fmease

Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`

Make e.g. #144323 more obvious who should be reviewing it and easier to filter.
@traviscross
Copy link
Contributor

We talked about this in the style team call today. Specifically, we looked at the formatting of this test case:

cfg_select! {
    feature = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff"
    => {
        // abc
    }
    feature = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff"
        => {
        // abc
    }
    _ => {
        // abc
    }
}

What the PR currently does is this:

cfg_select! {
    feature = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff" => {}
    feature = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff" => {}
    _ => {}
}

What we'd like to do instead, when the maximum line length is exceeded, is to break before = and then outdent the =>. So we end up with code that looks, e.g., like:

cfg_select! {
    feature
        = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff"
    => {
        println!();
    }
    feature
        = "debug-with-rustfmt-long-long-long-long-loooooooonnnnnnnnnnnnnnnggggggffffffffffffffff"
    => {}
    anything(
        "some other long long long long long thing long long long long long long long long long long long",
    ) => {}
}

One thing that motivated us here is that feature isn't actually a language feature, as discussed here:

https://doc.rust-lang.org/nightly/reference/conditional-compilation.html#r-cfg.options.crate

It's just a convention. Therefore, what's on the LHS there (even setting aside the effects of any(..), all(..), etc.) can be an arbitrary user-specified identifier that's arbitrarily long. This convinced us out of wanting to try to custom-fit some heuristic tuned to the length of the feature token. Wrapping in this way might not be perfect, but it's the best of the maybe bad options when lines get to be like this.

Notably, breaking before the = is different than what we currently do elsewhere. We do break before other infix operators, but we special case assignment and break after the token for that. In a future style edition, we're interested in fixing that, and so we're steering toward that outcome now with this.

Similarly, we don't currently line break normal attributes in this way, but we want to do for cfg_select! what we're likely to do in a future edition for all attributes.

For editions, traditionally for lang work,, we've prioritized inter-edition consistency over intra-edition consistency. So, e.g., when we introduced features like RPITIT to older editions, we did so with the Rust 2024 lifetime capture rules even before we'd shipped Rust 2024 or stabilized the behavior in the nightly edition. That's similar to the model here. Since we know we want to change how we handle attributes, we'll do it first here, with cfg_select!, then we'll propagate that to other positions over the style edition.

@calebcartwright, I think we may have settled parts of this after you had to drop, so please let us know if anything doesn't sound right here.

@folkertdev, if you could update the PR and the tests accordingly, that'd be good. We'll also need a PR to the style guide for this.

Note as well that these will need to be updated to account for the change in:

Thanks for working on this.

@folkertdev folkertdev force-pushed the cfg-select-builtin-macro-fmt branch from 17d516f to f3acdc9 Compare August 23, 2025 12:14
@rustbot
Copy link
Collaborator

rustbot commented Aug 23, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@folkertdev
Copy link
Contributor Author

I added the new formatting rule for long key-value meta items. The implementation is a bit hacky though. I'd really appreciate some rustfmt feedback on the general approach here, and whether we can break anything out (maybe the refactor of the macro_rules! logic?).

I also have some practical rustfmt implementation questions:

  • how can I figure out whether the macro will expand to an expression (where potentially the rhs does not need braces)
  • when in an expression context, how can i figure out whether the rhs fits on a single line (i.e. no braces, just a trailing ,)

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
88 |         => {
   |            - this delimiter might not be properly closed...
89 |         // abc
90 |     }
   |     - ...as it matches this but it has different indentation
...
94 | }
   | ^ unexpected closing delimiter

test test::verify_config_test_names ... ok
---

failures:

---- test::system_tests stdout ----
2025-08-23T13:15:56.376846Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:56.388725Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:56.393014Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:56.393022Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:56.396955Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-08-23T13:15:56.402426Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:56.510153Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `merge_imports` option is deprecated. Use `imports_granularity="Crate"` instead
2025-08-23T13:15:56.751166Z  WARN rustfmt_nightly::test: Default value [] used explicitly for skip_macro_invocations
2025-08-23T13:15:56.804092Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:56.841008Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:56.841013Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-08-23T13:15:56.843015Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-08-23T13:15:56.876893Z  WARN rustfmt_nightly::test: Default value Default used explicitly for use_small_heuristics
2025-08-23T13:15:56.880687Z  WARN rustfmt_nightly::test: Default value Never used explicitly for match_arm_leading_pipes
2025-08-23T13:15:56.884478Z  WARN rustfmt_nightly::test: Default value true used explicitly for merge_derives
2025-08-23T13:15:56.890898Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_macro_matchers
2025-08-23T13:15:56.895262Z  WARN rustfmt_nightly::test: Default value true used explicitly for force_explicit_abi
2025-08-23T13:15:56.898648Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-08-23T13:15:56.904631Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:56.908722Z  WARN rustfmt_nightly::test: Default value true used explicitly for match_arm_blocks
2025-08-23T13:15:56.914551Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:56.914556Z  WARN rustfmt_nightly::test: Default value false used explicitly for format_strings
2025-08-23T13:15:56.918125Z  WARN rustfmt_nightly::test: Default value Tall used explicitly for fn_params_layout
2025-08-23T13:15:56.921781Z  WARN rustfmt_nightly::test: Default value Block used explicitly for imports_indent
2025-08-23T13:15:56.921786Z  WARN rustfmt_nightly::test: Default value Mixed used explicitly for imports_layout
2025-08-23T13:15:56.923569Z  WARN rustfmt_nightly::test: Default value 4 used explicitly for tab_spaces
2025-08-23T13:15:56.923573Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:56.925360Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:56.929126Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for doc_comment_code_block_width
2025-08-23T13:15:56.931156Z  WARN rustfmt_nightly::test: Default value 100 used explicitly for doc_comment_code_block_width
2025-08-23T13:15:56.935076Z  WARN rustfmt_nightly::test: Default value Wide used explicitly for type_punctuation_density
2025-08-23T13:15:56.952898Z  WARN rustfmt_nightly::test: Default value AlwaysSameLine used explicitly for control_brace_style
2025-08-23T13:15:56.960442Z  WARN rustfmt_nightly::test: Default value false used explicitly for normalize_doc_attributes
2025-08-23T13:15:56.964023Z  WARN rustfmt_nightly::test: Default value false used explicitly for reorder_impl_items
2025-08-23T13:15:56.967513Z  WARN rustfmt_nightly::test: Default value false used explicitly for normalize_comments
2025-08-23T13:15:56.970965Z  WARN rustfmt_nightly::test: Default value false used explicitly for hard_tabs
2025-08-23T13:15:56.976247Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-08-23T13:15:56.979773Z  WARN rustfmt_nightly::test: Default value SameLineWhere used explicitly for brace_style
2025-08-23T13:15:56.983275Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:56.986971Z  WARN rustfmt_nightly::test: Default value false used explicitly for force_multiline_blocks
2025-08-23T13:15:56.988910Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-08-23T13:15:56.992571Z  WARN rustfmt_nightly::test: Default value 80 used explicitly for comment_width
2025-08-23T13:15:56.995984Z  WARN rustfmt_nightly::test: Default value false used explicitly for fn_single_line
2025-08-23T13:15:56.997714Z  WARN rustfmt_nightly::test: Default value true used explicitly for remove_nested_parens
2025-08-23T13:15:57.001148Z  WARN rustfmt_nightly::test: Default value false used explicitly for condense_wildcard_suffixes
2025-08-23T13:15:57.004620Z  WARN rustfmt_nightly::test: Default value Vertical used explicitly for trailing_comma
2025-08-23T13:15:57.011850Z  WARN rustfmt_nightly::test: Default value false used explicitly for match_block_trailing_comma
2025-08-23T13:15:57.017241Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.019317Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.019322Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:57.021449Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:57.021453Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.021455Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.030704Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.035990Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.037780Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.041383Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:57.043137Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.046682Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.048443Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.051968Z  WARN rustfmt_nightly::test: Default value Block used explicitly for indent_style
2025-08-23T13:15:57.055631Z  WARN rustfmt_nightly::test: Default value false used explicitly for spaces_around_ranges
2025-08-23T13:15:57.060980Z  WARN rustfmt_nightly::test: Default value 10 used explicitly for short_array_element_width_threshold
2025-08-23T13:15:57.066308Z  WARN rustfmt_nightly::test: Default value false used explicitly for use_try_shorthand
2025-08-23T13:15:57.068105Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-08-23T13:15:57.077880Z  WARN rustfmt_nightly::test: Default value false used explicitly for use_field_init_shorthand
2025-08-23T13:15:57.079727Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-08-23T13:15:57.083456Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-08-23T13:15:57.090231Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_generated_files
2025-08-23T13:15:57.094416Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:57.094421Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-08-23T13:15:57.098003Z  WARN rustfmt_nightly::test: Default value false used explicitly for disable_all_formatting
2025-08-23T13:15:57.099998Z  WARN rustfmt_nightly::test: Default value true used explicitly for empty_item_single_line
2025-08-23T13:15:57.109687Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-08-23T13:15:57.121101Z  WARN rustfmt_nightly::test: Default value false used explicitly for error_on_line_overflow
2025-08-23T13:15:57.126170Z  WARN rustfmt_nightly::test: Default value 50 used explicitly for single_line_let_else_max_width
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-08-23T13:15:57.227533Z  WARN rustfmt_nightly::test: Default value One used explicitly for version
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-08-23T13:15:57.333196Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.345035Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.379605Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.401965Z  WARN rustfmt_nightly::test: Default value true used explicitly for merge_derives
2025-08-23T13:15:57.477490Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for edition
2025-08-23T13:15:57.501250Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.544747Z  WARN rustfmt_nightly::test: Default value true used explicitly for format_macro_bodies
2025-08-23T13:15:57.553990Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.562630Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.605799Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_imports
2025-08-23T13:15:57.616195Z  WARN rustfmt_nightly::test: Default value true used explicitly for reorder_modules
2025-08-23T13:15:57.779197Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: the `version` option is deprecated. Use `style_edition` instead.
2025-08-23T13:15:57.863865Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.916345Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
2025-08-23T13:15:57.992600Z  WARN rustfmt_nightly::test: Default value false used explicitly for wrap_comments
2025-08-23T13:15:58.081753Z  WARN rustfmt_nightly::test: Default value 2015 used explicitly for style_edition
Ran 616 system tests.

thread '<unnamed>' (59899) panicked at src/tools/rustfmt/src/test/mod.rs:189:9:
assertion `left == right` failed: 1 system tests failed
  left: 1

Comment on lines +321 to +331
overflow::rewrite_with_parens(
context,
&path,
list.iter(),
shape
.sub_width("]".len())
.max_width_error(shape.width, this.span)?,
this.span,
context.config.attr_fn_like_width(),
Some(separator_tactic),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this returns an Unknown error when the list items are too long, e.g.

    anything(
        "some other long long long long long thing long long long long long long long long long long long",
    ) => {
        // abc
    }

I'm not sure what to do with that really: is just bailing completely the right approach, or is there some sort of way to still format this in a somewhat reasonable fashion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustfmt Area: Rustfmt F-cfg_select `#![feature(cfg_select)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants